package com.test;

public class MethodTest4 {
    public static void main(String[] args) {
        /*
        需求:使用方法重载的思想，设计比较两个整数是否相同的方法。
        要求:兼容全整数类型（byte,short,int,long)
        */
        compare(10,20);
        byte a=10;
        byte b=10;
        compare(a,b);
        short c=10;
        short d=20;
        compare(c,d);
        compare(100L,100L);
    }
    public static void compare(byte b1,byte b2){
            System.out.println("(byte类型)"+(b1==b2));
    }
    public static void compare(short s1,short s2){
            System.out.println("(short类型)"+(s1==s2));
    }
    public static void compare(int i1,int i2){
            System.out.println("(int类型)"+(i1==i2));
    }
    public static void compare(long n1,long n2){
            System.out.println("(long类型)"+(n1==n2));
    }
}
